﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace Wheeler.Web.ViewModels
{
    public class ChangePasswordModel
    {
        [Required(ErrorMessage = "Please enter your old password")]
        [DataType(DataType.Password)]
        [Display(Name = "Old Password")]
        public string OldPassword { get; set; }

        [Required(ErrorMessage = "Please enter a New password")]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirm password do not match.")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required]
        [Display(Name = "User name")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [Display(Name = "Remember me?")]
        public bool RememberMe { get; set; }
    }

    public class RegisterModel
    {
        //[Required]
        //[Display(Name = "User name")]
        //public string UserName { get; set; }

        [Required(ErrorMessage = "Please enter an Email address")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Please Enter a valid Email address")]
        [Display(Name = "Email address")]
        public string Email { get; set; }

        //[Required(ErrorMessage = "Please enter an User ID")]
        //[DataType(DataType.Text)]
        ////[RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Please Enter a valid Email address")]
        //[Display(Name = "User ID")]
        //public string UserID { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The Password and Confirm password do not match.")]
        public string ConfirmPassword { get; set; }
    }

    public class CompanyRegisterModel
    {
        [Required(ErrorMessage = "Please enter a Company Name")]
        [DataType(DataType.Text)]
        [StringLength(100, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Company Name")]
        public string CompanyName { get; set; }

        [Required(ErrorMessage = "Please enter Your Name")]
        [DataType(DataType.Text)]
        [StringLength(150, ErrorMessage = "{0} can be maximum {1} characters long.")]
        [Display(Name = "Your Name")]
        public string ContactName { get; set; }

        [Required(ErrorMessage = "Please enter an Email address")]
        [StringLength(100, ErrorMessage = "{0} can be maximum {1} characters long.")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Please Enter a valid Email address")]
        [Display(Name = "Your Email")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Please enter an User Name")]
        [DataType(DataType.Text)]
        [StringLength(150, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "User Name")]
        public string UserName { get; set; }

        [Required]
        [StringLength(50, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The Password and Confirm password do not match.")]
        public string ConfirmPassword { get; set; }
    }
}
